import { findTypeByValue, findTypeByLabel } from '@/utils/findType'
import * as types from "./types"

// 渠道Table
export const configTableFrame = [
  { 
    prop: "num", 
    label: "序号", 
    minWidth: "50px", 
    tooltip: true 
  },
  { 
    prop: "title", 
    label: "标题", 
    minWidth: "150px"
  },
  { 
    prop: "type", 
    label: "类型",
    minWidth: "100px",
    formatter: (row) => {
      return findTypeByValue(row.type, types.questionType);
    }
  },
  {
    prop: "icon",
    label: "图标",
    slotName: "icon", 
    minWidth: "150px"
  },
  {
    prop: "thumb",
    label: "焦点图",
    slotName: "thumb", 
    minWidth: "250px"
  },
  {
    prop: "createUser",
    label: "发布者",
    minWidth: "100px"
  },
  {
    prop: "isTop",
    label: "是否置顶",
    minWidth: "100px",
    formatter: (row) => {
      return row.isTop ? "是" : "否"
    }
  },
  {
    prop: "sortNo",
    label: "排序",
    minWidth: "100px"
  },
  {
    prop: "model",
    label: "绑定Agent",
    minWidth: "200px",
    formatter: (row) => {
      return row.modelVo ? row.modelVo.name : ''
    }
  },
  { 
    label: "操作", 
    slotName: "operate", 
    fixed: "right",
    minWidth: "150px"
  },
];


export const searchFrame = [
  { 
    label: "标题", 
    key: "title", 
    type: 1
  }
]
